//
//  ViewController.m
//  test
//
//  Created by Chen Heren on 16/10/12.
//  Copyright (c) 2016年 Chen Heren. All rights reserved.
//

#import "ViewController.h"
#import  "CHRScrollView.h"

@interface ViewController ()<CHRScrollViewDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    NSURL *url = [[NSBundle mainBundle]URLForResource:@"1" withExtension:@".png"];
    NSURL *ur2 = [[NSBundle mainBundle]URLForResource:@"2" withExtension:@".png"];
    NSURL *ur3 = [[NSBundle mainBundle]URLForResource:@"3" withExtension:@".png"];
    NSURL *ur4 = [[NSBundle mainBundle]URLForResource:@"4" withExtension:@".png"];
    CHRScrollView *scrollView = [[CHRScrollView alloc]initWithFrame:CGRectMake(0, 100, self.view.frame.size.width, 200) ImageUrls:@[url,ur2,ur3,ur4] IntervalTime:2];
    scrollView.delegate = self;
    [self.view addSubview:scrollView];
    
}


-(void)CHRScrollView:(CHRScrollView *)scrollView selectedAt:(NSInteger)index{
    NSLog(@"%ld",index);
}

@end
